######################################
#
######################################
OBJ_FOLDER := $(LOCAL_PATH)/objs
vpath %.cpp audio video
#source file
#源文件，自动找所有.cpp文件，并将目标定义为同名.o文件
SOURCE  := $(wildcard *.cpp) $(wildcard audio/*.cpp) $(wildcard video/*.cpp)
OBJS := $(SOURCE:%.cpp=${OBJ_FOLDER}/%.o)

#target you can change test to what you want
#目标文件名，输入任意你想要的执行文件名
TARGET  := $(LOCAL_PATH)/separator

#compile and lib parameter
#编译参数
CC      := g++
LIBS    :=
LDFLAGS :=
DEFINES :=
INCLUDE := -I.
CFLAGS  := -g -Wall -O3 $(DEFINES) $(INCLUDE)
CXXFLAGS:= $(CFLAGS)

#i think you should not fix anything here
#下面的基本上不需要做任何改动了
.PHONY : all everything clean veryclean rebuild

all : $(TARGET)

everything : $(TARGET)

${OBJS} : $(OBJ_FOLDER)/%.o : %.cpp
	mkdir -p $(OBJ_FOLDER)/$(<D)
	$(CC) -c $(CXXFLAGS) $< -o $@

rebuild: veryclean everything

clean :
	rm -fr *.so
	rm $(OBJS)

veryclean : clean
	rm -fr $(TARGET)

$(TARGET) : $(OBJS)
	$(CC) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)